package com.gxa.saas.sso.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gxa.saas.core.entity.User;
import com.gxa.saas.core.entity.vo.luoj.UserVO;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;

public interface UserService extends IService<UserVO> {

    /**
     * 用户一键注册/登录的方法
     * @param phone
     * @param check
     * @return 返回token字符串，交由前端保存（localStorage）
     */
    String login(@Validated @NotEmpty(message = "手机号不能为空") String phone,
                 @Validated @NotEmpty(message = "验证码不能为空") String check) throws Exception;

    /**
     * 用token返回用户信息
     * @param token
     * @return
     */
    UserVO checkWithToken(@Validated @NotEmpty(message = "token不能为空") String token) throws Exception;
//
//    String getSessionId(@Validated @NotEmpty(message = "code不能为空")String code);

    UserVO userInfo(@Validated @NotEmpty(message = "手机号不能为空") String phone);
}
